package com.example.spareparts.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.example.spareparts.entity.BatchManagement;
import com.example.spareparts.repository.BatchManagementRepository;

@Service
public class BatchManagementService {
    @Autowired
    private BatchManagementRepository batchManagementRepository;
    public List<BatchManagement> findAllBatchManagement(){
        return batchManagementRepository.findAllBatchManagement();
    }
    public void insertBatchManagement(BatchManagement batchManagement){
        batchManagementRepository.insertBatchManagement(batchManagement);
    }
    public void updateBatchManagement(BatchManagement batchManagement){
        batchManagementRepository.updateBatchManagement(batchManagement);
    }
    public void deleteBatchManagement(Long batchid){
        batchManagementRepository.deleteBatchManagement(batchid);
    }
    public BatchManagement findBatchManagementById(Long batchid){
        return batchManagementRepository.findBatchManagementById(batchid);
    }
    public List<BatchManagement> findBatchManagementBySparePartId(Long sparepartid){
        return batchManagementRepository.findBatchManagementBySparePartId(sparepartid);
    }
    public BatchManagement findBatchManagementByBatchNumber(String batchNumber){
        return batchManagementRepository.findBatchManagementByBatchNumber(batchNumber);
    }

}
